package top.hongsheng9527.bookdownload;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import top.hongsheng9527.bookdownload.ui.StartJFrame;

import javax.swing.*;
import java.awt.*;

/**
 * @author Wanghs
 * @create 2022/4/8
 * @description
 */
@SpringBootApplication
@ServletComponentScan
@EnableAsync
@MapperScan(basePackages = {"top.hongsheng9527.bookdownload.mapper"})
@Slf4j
public class BookDownloadApplication {
    private static final String TARGET_URL = "cmd /c start http://localhost:8081/swagger-ui.html#/";

    public static void main(String[] args) {
        SpringApplication.run(BookDownloadApplication.class, args);
        try {
            Runtime.getRuntime().exec(TARGET_URL);
        } catch (Exception e) {
            log.error("访问txt下载器异常:{}", e);
        }
//        System.setProperty("java.awt.headless", "false");
//        StartJFrame.start();
    }

}
